/**
 * IndexModule 业务逻辑实现类
 * @author WangXinLei
 * @date 2015-01-27
 */
package com.chnbst.bstyun.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.chnbst.bstyun.core.base.BaseService;
import com.chnbst.bstyun.core.common.helper.DaoHelper;
import com.chnbst.bstyun.model.pojo.IndexModule;
import com.chnbst.bstyun.model.vo.IndexModuleVo;
import com.chnbst.bstyun.service.IndexModuleService;

@Transactional
@Service
public class IndexModuleServiceImpl  extends BaseService implements IndexModuleService{
	//命名空间
	private final static String nameSpace = "com.chnbst.bstyun.mapper.IndexModuleMapper";

	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<IndexModuleVo> selectGrid() {
		return (List<IndexModuleVo>) DaoHelper.list(nameSpace, "selectGrid", null);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean insertIndexModule(IndexModule indexModule) {
		return DaoHelper.insert(nameSpace, "insertIndexModule", indexModule);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean updateIndexModule(IndexModule indexModule) {
		return DaoHelper.update(nameSpace, "updateIndexModule", indexModule);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public IndexModuleVo selectIndexModuleById(String moduleId) {
		return (IndexModuleVo) DaoHelper.query(nameSpace, "selectIndexModuleById", moduleId);
	}

	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<IndexModuleVo> selectIndexModule() {
		return (List<IndexModuleVo>) DaoHelper.list(nameSpace, "selectIndexModule", null);
	}
}
